Skip to content

Use symlink_dir to create junctions on Windows instead of trying to use symbolic links in copy_link_internal - #152433

Open
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:bootstrap-symlink
Open

Use symlink_dir to create junctions on Windows instead of trying to use symbolic links in copy_link_internal#152433
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:bootstrap-symlink

Conversation

@Zoxc

@Zoxc Zoxc commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

View all comments

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in symlink_file when operating on a directory.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 10, 2026
@rustbot

rustbot commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, Zalathar, clubby789, jieyouxu

@rust-log-analyzer

This comment has been minimized.

@ChrisDenton

Copy link
Copy Markdown
Member

Junction points only work on directories, not files. A hard link or a file copy would be necessary if symlinks aren't available.

@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from 31820df to 6e0c9f5 Compare February 10, 2026 12:02
@Zoxc

Zoxc commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

Well this seems to only be called to create junctions to directories (on Windows), otherwise I'd be seeing more privilege errors.

@ChrisDenton

Copy link
Copy Markdown
Member

So it sounds like symlink_dir should be being called and it's a bug that symlink_file is.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rustbot author

I don't have much context on the details here (especially Windows) but generally speaking it seems plausible that this is a bug in the callsite?

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 14, 2026
@rustbot

rustbot commented Feb 14, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from 6e0c9f5 to 4ce1afa Compare February 22, 2026 16:01
@rustbot

This comment has been minimized.

@Zoxc Zoxc changed the title Create junctions instead of trying to use symbolic links in symlink_file on Windows Use symlink_dir to create junctions on Windows instead of trying to use symbolic links in copy_link_internal Feb 22, 2026
@rust-bors

This comment has been minimized.

… use symbolic links in `copy_link_internal`
@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from 4ce1afa to bbd34d2 Compare August 21, 2026 14:29
@rustbot

rustbot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zoxc

Zoxc commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

I have moved the logic to the callsite.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 21, 2026
@ChrisDenton

Copy link
Copy Markdown
Member

I should be able to look at this later today

r? ChrisDenton

@ChrisDenton

Copy link
Copy Markdown
Member

lgtm

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit bbd34d2 has been approved by ChrisDenton

It is now in the queue for this repository.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 21, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #151061 (Build rustc and codegen backends with -Zembed-metadata=no)
 - #157949 (Allow self in const generics)
 - #158588 (trait_selection: fix assumptions-on-binders diagnostics)
 - #159954 (core: implement float conversion methods)
 - #160136 (Add `Default` implementation for `std::sync::Once`)
 - #160835 (resolver diagnostics: don't swallow labels and point out  similar items as a note, not a label)
 - #161048 (Improve the ABI between the panic runtime and libstd)
 - #161292 (Add safety comments in alloc::Wtf8)
 - #161444 (Add some `rustc_type_ir` comments)
 - #161465 (Remove leftover immediate creation)
 - #152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - #159098 (Add Arc/Rc::strong_count_from_raw)
 - #159282 (Update documentation for `-Zdump-dep-graph`)
 - #161401 (Remove fields from TypeKind: Bool, Char, Float and Int)
 - #161431 (bootstrap: (offload) be stricter about selected compiler and paths)
 - #161451 (Avoid arming the Windows TLS destructor guard in fibers)
 - #161463 (Add myself to mailmap)
 - #161476 (Use bitset for locals_with_use_data)

Failed merges:

 - #161443 (add internal DSL for testing binders)
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=x86_64-gnu-distcheck

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`


try-job: x86_64-gnu-distcheck
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #161494 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2026
@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#161501), which was unapproved.

View changes since this unapproval

@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 35a958f failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-distcheck failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   2: <bootstrap::core::session::Build>::copy_link_internal
             at /checkout/src/bootstrap/src/utils/helpers.rs:56:27
   3: <bootstrap::core::session::Build>::copy_link
             at /checkout/src/bootstrap/src/core/session.rs:1567:14
   4: <bootstrap::core::session::Build>::cp_link_filtered_recurse
             at /checkout/src/bootstrap/src/core/session.rs:1688:26
   5: <bootstrap::core::session::Build>::cp_link_filtered_recurse
             at /checkout/src/bootstrap/src/core/session.rs:1686:26
   6: <bootstrap::core::session::Build>::cp_link_filtered_recurse
             at /checkout/src/bootstrap/src/core/session.rs:1686:26
   7: <bootstrap::core::session::Build>::cp_link_filtered_recurse
             at /checkout/src/bootstrap/src/core/session.rs:1686:26
   8: <bootstrap::core::session::Build>::cp_link_filtered_recurse
             at /checkout/src/bootstrap/src/core/session.rs:1686:26
   9: <bootstrap::core::session::Build>::cp_link_filtered
             at /checkout/src/bootstrap/src/core/session.rs:1664:14
  10: bootstrap::core::build_steps::dist::copy_src_dirs
             at /checkout/src/bootstrap/src/core/build_steps/dist.rs:1184:14
  11: bootstrap::core::build_steps::dist::prepare_source_tarball
             at /checkout/src/bootstrap/src/core/build_steps/dist.rs:1378:5
---
  18: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::Distcheck>
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1636:36
  19: <bootstrap::core::build_steps::test::Distcheck as bootstrap::core::builder::CommandLineStep>::make_run
             at /checkout/src/bootstrap/src/core/build_steps/test.rs:3864:21
  20: <bootstrap::core::builder::CommandLineStepDescription>::maybe_run
             at /checkout/src/bootstrap/src/core/builder/mod.rs:469:13
  21: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at /checkout/src/bootstrap/src/core/builder/cli_paths.rs:138:19
  22: <bootstrap::core::builder::Builder>::run_step_descriptions
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1150:9
  23: <bootstrap::core::builder::Builder>::execute_cli
             at /checkout/src/bootstrap/src/core/builder/mod.rs:1108:14
  24: <bootstrap::core::session::Build>::build
             at /checkout/src/bootstrap/src/core/session.rs:631:25
  25: bootstrap::cli_main::main
             at /checkout/src/bootstrap/src/cli_main.rs:162:11
  26: bootstrap::main
             at /checkout/src/bootstrap/src/bin/main.rs:7:5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants